package com.sys.manage.service;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import com.sys.api.Service.ManagerLoginService;
import com.sys.common.ZuelResult;
import com.sys.manage.dao.ManagerDao;
import com.sys.pojo.ManagerModel;

@Service
public class ManagerLoginServiceImpl implements ManagerLoginService {

	@Autowired
	private ManagerDao managerDao;
	
	@Override
	public ZuelResult ManagerLogin(ManagerModel manager) {
		// TODO Auto-generated method stub
		ManagerModel model  = managerDao.findByUsername(manager.getUsername());
		if (model==null) {
			return ZuelResult.error(null,"没有这个客服哦~");
		}
		if (!model.getPasswords().equals(manager.getPasswords())) {
			return  ZuelResult.error(null,"密码错误哦~大兄弟");
		}else {
			return  ZuelResult.ok(null, "客服登录成功");
		}
		
	}

	
}
